package cn.com.mjsoft.framework.persistence.core.type;

import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * sql null值处理。
 * @author mjsoft
 * 
 */
public class SqlTypeNull extends AbstractCustomTypeValue
{
    public SqlTypeNull( Integer sqlType, String typeName, Object value )
    {
        super( sqlType, typeName, value );
    }

    public void setTypeValue( PreparedStatement ps, int paramIndex )
        throws SQLException
    {
        if( typeName != null )
        {
            ps.setNull( paramIndex, sqlType.intValue(), typeName );
        }
        else
        {
            ps.setNull( paramIndex, sqlType.intValue() );
        }
    }

}
